package com.itheima.dao;

import com.itheima.pojo.IdCard;
import com.itheima.pojo.T_Class;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ClassMapper {
    @Select("select * from c_class where id=#{id}")
    @Results({@Result(id = true,column = "id"),
            @Result(column = "classname",property = "classname"),
            @Result(column = "id",property = "studentList",
                    many = @Many(select =
                            "com.itheima.dao.StudentMapper.selectAllStudentId"))
    })
    T_Class selectClassById(int id);

}
